import request from "@/utils/request";

export const projectListService = (params) => {
  return request.get("/api/testCase/list", { params });
};

export const testCaseDetailService = (params) => {
  return request.get(`/api/testCase/detail/${params.id}`);
};

export const testCaseAddService = (data) => {
  return request.post("/api/testCase/add", data);
};

export const testCaseUpdateService = (data) => {
  return request.post("/api/testCase/update", data);
};

export const testCaseDeleteService = (params) => {
  return request.delete(`/api/testCase/delete/${params.id}`);
};

export const testCaseGetConfigDataService = () => {
  return request.get("/api/testCase/config/data");
};

export const testCaseImportService = (data) => {
  return request.post("/api/fileProcess/upload", data, {
    headers: {
      "Content-Type": "multipart/form-data",
    },
  });
};

export const testCaseDownloadService = () => {
  return request.get("/api/fileProcess/download", { responseType: "blob" });
};
